<!DOCTYPE html>
<html class="x-admin-sm">

{include file="common/static" /}
{include file="common/resources" /}
    <body>
        <div class="x-nav">
            <span class="layui-breadcrumb">
                <a href="">首页</a>
                <a href="">演示</a>
                <a>
                    <cite>导航元素</cite></a>
            </span>
            <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" onclick="location.reload()" title="刷新">
                <i class="layui-icon layui-icon-refresh" style="line-height:30px"></i>
            </a>
        </div>
        <div class="layui-fluid">
            <div class="layui-row layui-col-space15">
                <div class="layui-col-md12">
                    <div class="layui-card">
                        <div class="layui-card-body ">
                            <form class="layui-form layui-col-space5">
                                <div class="layui-input-inline layui-show-xs-block">
                                    <input class="layui-input" placeholder="开始日" name="start" id="start"></div>
                                <div class="layui-input-inline layui-show-xs-block">
                                    <input class="layui-input" placeholder="截止日" name="end" id="end"></div>
                                <div class="layui-input-inline layui-show-xs-block">
                                    <select name="contrller">
                                        <option>支付方式</option>
                                        <option>支付宝</option>
                                        <option>微信</option>
                                        <option>货到付款</option></select>
                                </div>

                                <div class="layui-input-inline layui-show-xs-block">
                                    <input type="text" name="username" placeholder="请输入订单号" autocomplete="off" class="layui-input">
                                </div>
                                <div class="layui-input-inline layui-show-xs-block">
                                    <button class="layui-btn" lay-submit="" lay-filter="sreach">
                                        <i class="layui-icon">&#xe615;</i></button>
                                </div>
                            </form>
                        </div>

                        <div class="layui-card-body ">
                            <table class="layui-table layui-form">
                                <thead>
                                    <tr>
                                        <th>ID</th>
                                        <th>房型</th>
                                   <!--     <th>价格</th>
                                        <th>下单时间</th>-->
                                        {volist name='week' id='w'}
                                        <th>{$w}</th>
                                        {/volist}
                                        <th>操作</th>
                                    </tr>
                                </thead>
                                <tbody>
                                {volist name='list' id='vo'}
                                    <tr>
                                        <td>{$vo.id}</td>
                                        <td>{$vo.type_name}</td>
                                        <td>
                                            <input type="text" id="monday{$vo.id}" lay-verify="required"
                                                   autocomplete="off" class="layui-input" value="{$vo.monday}">
                                        </td>
                                        <td>
                                            <input type="text" id="tuesday{$vo.id}" lay-verify="required"
                                                   autocomplete="off" class="layui-input" value="{$vo.tuesday}">
                                        </td>
                                        <td>
                                            <input type="text" id="wednesday{$vo.id}" lay-verify="required"
                                                   autocomplete="off" class="layui-input" value="{$vo.wednesday}">
                                        </td>
                                        <td>
                                            <input type="text" id="thursday{$vo.id}" lay-verify="required"
                                                   autocomplete="off" class="layui-input" value="{$vo.thursday}">
                                        </td>
                                        <td>
                                            <input type="text" id="friday{$vo.id}" lay-verify="required"
                                                   autocomplete="off" class="layui-input" value="{$vo.friday}">
                                        </td>
                                        <td>
                                            <input type="text" id="saturday{$vo.id}" lay-verify="required"
                                                   autocomplete="off" class="layui-input" value="{$vo.saturday}">
                                        </td>
                                        <td>
                                            <input type="text" id="sunday{$vo.id}" lay-verify="required"
                                                   autocomplete="off" class="layui-input" value="{$vo.sunday}">
                                        </td>
                                        <td class="td-manage">
                                            <a title="查看" onclick="edits({$vo.id})">
                                                <i class="layui-icon">&#xe63c;</i></a>
                                        </td>
                                    </tr>
                                {/volist}
                                </tbody>
                            </table>
                        </div>
                        <div class="layui-card-body ">
                            <div class="page">
                                <div>
                                    <a class="prev" href="">&lt;&lt;</a>
                                    <a class="num" href="">1</a>
                                    <span class="current">2</span>
                                    <a class="num" href="">3</a>
                                    <a class="num" href="">489</a>
                                    <a class="next" href="">&gt;&gt;</a></div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </body>

<script>layui.use(['laydate', 'form'],
        function() {
            var laydate = layui.laydate;

            //执行一个laydate实例
            laydate.render({
                elem: '#start' //指定元素
            });

            //执行一个laydate实例
            laydate.render({
                elem: '#end' //指定元素
            });
        });

    function edits(id){
        $.ajax({
            type:"post",
            url: "{:url('index/pricesystem/edits')}",
            data: {
                id:id,
                monday:$('#monday'+id).val(),
                tuesday:$('#tuesday'+id).val(),
                wednesday:$('#wednesday'+id).val(),
                thursday:$('#thursday'+id).val(),
                friday:$('#friday'+id).val(),
                saturday:$('#saturday'+id).val(),
                sunday:$('#sunday'+id).val()
            },
            success: function(data){
                console.log(data);
                toastr.error(data.msg);
                if(data.code == 100){
                    setTimeout(function () {
                        parent.location.reload();
                    },1000);
                }
            }});
    }
</script>


</html>